package com.an.vhr.controller.exception;

import com.an.vhr.bean.RespBean;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import java.sql.SQLException;

/**
 * @Author: an1089
 **/
@RestControllerAdvice
public class GlobalException {
    @ExceptionHandler(SQLException.class)
    public RespBean sqlException(SQLException e){
        System.out.println(e.getMessage());
        return RespBean.error("数据库异常！");
    }
}
